1. Field of the Invention
This invention relates generally to systems and methods for configuring logic control units in distributed process control systems, and more particularly to a computer implemented programming process used to program a logic control unit based on a form of state machine theory.
2. Description of the Prior Art
Distributed process control systems are widely used in many applications including machine tools, material handling, assembling systems, molding and casting machines, and robotics systems. Such systems typically include a logic control unit (LCU) such as a commercially available programmable logic controller (PLC) which is a specialized data processor. A PLC typically includes a plurality of input ports for receiving analog and digital input signals from components of the system under control, a plurality of output ports providing digital and analog output signals to components of the system, a microprocessor, and memory for storing a control program. The PLC operates by repetitively scanning the signals present at the input ports to determine input data, analyzing the input data using the control program stored in memory to determine the corresponding output data, and providing output signals based on the output data at the output ports in order to control the system.
In accordance with one prior art method for configuring a PLC, a control program is created using a xe2x80x9cladder logicxe2x80x9d programming method. A ladder logic program typically includes a plurality or ladder logic statements commonly referred to as xe2x80x9crungsxe2x80x9d. Each ladder logic statement defines a relationship between variables such as between an output variable and an input variable. A simple ladder logic statement might indicate that a particular output variable is ON if and only if variables A and B are both ON. For easier comprehension by ladder logic programmers, ladder logic editors use ladder logic statements, and programs are often expressed in terms of ladder logic graphs including input symbols, line segments, and variable names.
Ladder logic programs are created and edited using a programming computer system separate from the PLC such as a personal computer or mini computer. A complete ladder logic program is recorded on magnetic tape or disk, and uploaded from the programming computer system into the memory of the PLC.
An important problem with prior art methods for programming logic control units, such as those using a ladder logic editor, is that a skilled ladder logic programmer is needed to create a ladder logic program. In accordance with a typical prior art PLC development cycle, development begins with a hardware applications engineer who designs and builds the hardware for the system under control. A PLC programmer then interfaces with the hardware application engineer who describes specifications of the system to the programmer. The programmer then begins software development. Typically the hardware engineer cannot read the ladder logic program listing either in the form of ladder logic instructions or in the ladder logic graph form. Therefore it is common that numerous problems with the control system are discovered by the hardware engineer only after executing the software over the PLC. When the application engineer begins to evaluate the performance of the system as controlled by the configured PLC, the engineer determines problems with the system which must then be communicated to the programmer. The programmer then reads the ladder logic graphs or statements in order to determine which rungs of the diagrams correspond with the problems in the implemented system which have been communicated to the programmer by the hardware application""s engineer. Although this repetitive communication between the programmer and applications engineer is awkward and time consuming, it is necessary because the hardware applications engineer is typically not skilled in the art of programming PLC""s using a ladder logic editor.
What is needed is a system and method for programming a logic control unit wherein the time required to develop and test the control program is reduced.
What is also needed is a system and method for programming a logic control unit wherein the programming process provides an interface which is easily understood by an applications engineer who is not trained in the arts of software engineering ladder logic instructions, or ladder logic graphs.
It is an object of the present invention to provide a system and method for programming a logic control unit wherein the time required to develop and test the control program is reduced.
It is also an object of the present invention to provide a system and method for programming a logic control unit wherein the programming process provides an interface which is easily understood by an applications engineer who is not trained in the arts of software engineering ladder logic instructions, or ladder logic graphs.
It is a further object of the present invention to provide such a system and method which is capable of generating programming listings describing the operation of the programmed process, the program listings being easily read and understood by an applications engineer who is not trained in the arts of software engineering.
It is yet another object of the present invention to provide a method of programming a logic controller wherein it is easy to effect and accommodate changes in the system under control. Further objects of the present invention include the provision of automatic flow chart generation, self-documenting functions, and improved quality of the controlling process.
The present invention provides a process for generating a control program for execution by a logic control unit having a plurality of input ports for receiving input signals from components of an external system under control, and a plurality of output ports for providing output signals to components of the external system. The process includes the steps of; providing a variable editing user interface allowing a user to define and edit variables including input variables associated with corresponding ones of the input signals, and output variables associated with corresponding ones of the output signals; and storing the variables in an internal file.
The process also includes the steps of; providing a state editing user interface allowing a user to define and edit a plurality of states of the control program, wherein selected ones of the variables are associated with corresponding ones of the states, and wherein each selected variable is assigned a corresponding selected data value upon transition of the control program to the selected corresponding state during execution of the control program by the logic control unit; and storing the states in the internal file. The process further includes the steps of; providing a condition editing user interface allowing a user to define and edit at least one condition for each of the states of the control program, each condition specifying a transition from an associated state as a source state to a corresponding selected destination state of the control program upon satisfaction of the condition during execution of the control program by the logic control unit; storing the conditions in the internal file; and generating the control program as a function of the associative relationships of the variables, the states, and the conditions stored in the internal file.
In a preferred embodiment, the process further includes the step of providing a program level editing user interface allowing the user to define and edit a plurality of program levels each including a corresponding plurality of the states, each program level for defining a sub-process of the control program, each program level for asynchronous execution by the logic control unit. The program levels include: at least one task program level; and at least one subroutine program level which may be called by a corresponding calling one of the program levels, the plurality of states of the corresponding calling program level including at least one state having a call condition associated therewith, the call condition specifying a transition from the associated state of the calling program level to a corresponding selected destination state of the corresponding subroutine program level. The plurality of states of the corresponding subroutine program level including at least one state having a return condition associated therewith, the return condition specifying that the control program is to transition to a return state of the corresponding calling program level upon satisfaction of the return condition during execution of the control program. The return state is indicated by a return state field associated with the calling condition of the corresponding calling program level. Each subroutine program level and corresponding calling program level are executed by the logic control unit in a single thread. Each of the program levels has a program level value field associated therewith, the program level value field for carrying a corresponding program level value uniquely identifying the program level.
Each of the states of each program level has a state address field associated therewith, the state address field for carrying a corresponding state address defined by the program level value of the corresponding program level, and a corresponding state value uniquely identifying the state. Each of the conditions has condition fields associated therewith, the condition fields including, a condition address field for carrying a corresponding condition address indicative of the conditions the condition address being formed by the program level value of the corresponding program level, the state value of the corresponding state, and a corresponding condition value uniquely identifying the corresponding condition, and a destination state address field carrying the state address of the corresponding selected destination state to which the process is to transition if the condition is determined to be true during execution of the control program by the logic control unit.
Each of the program levels has a program level name field associated therewith, the program level name field for receiving a user specified character string descriptive of the corresponding program level. Each of the states of each program level has a state name field associated therewith, the state name field for receiving a user specified character string descriptive of the corresponding state. The condition fields further include a condition name field for receiving a user specified character string descriptive of the corresponding condition.
The state values and the condition values are automatically generated sequentially by the programming process as the user defines the states and the conditions via the state editing user interface and the condition editing user interface respectively. The variables further comprise memory location variables including: at least one program variable for which an associated program variable data field is to be allocated by the logic control unit upon execution of the control program; and at least one digital variable for which an associated digital variable data field is to be allocated by the logic control unit upon execution of the control program.
The input variables include: analog input variables associated with corresponding analog input signals received from corresponding ones of the components of the external system; and digital input variables associated with corresponding digital input signals received from corresponding ones of the components of the external system. The output variables include: analog output variables associated with corresponding analog output signals provided to corresponding ones of the components of the external system; and digital output variables associated with corresponding digital output signals provided to corresponding ones of the components of the external system.
The conditions include condition statements for determining whether the transition from the associated source state to the corresponding destination state is to occur, the condition statements comprising check-state condition statements specifying that a selected check state one of the states must be active for the associated condition to be satisfied, the selected check state and the source state being associated with different ones of the program levels. Selected limited ones of the program levels are limited to be executed by the logic control unit only when corresponding selected limiting states are active, each limiting state being associated with a program level other then the corresponding limited program level.
The forgoing and other objects, features, and advantages of the present invention will be apparent from the following detailed description of the preferred embodiment which makes reference to the several figures of the drawing.